﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public void MapEKPOS(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }

        public void SaveEKPOS(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryEKPOS(dwData, 1);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            //MapEKPOS(ref dwLocal, dwData);
            //Because contains the RAW data in the databaes, so the dwData will not map to the dwLoacl
            //sunlight 20130815
            if (!flgExist)
            {
                InsertEKPOS(dwData);
            }
            UpdateEKPOS(dwData);
        }
        public void InsertEKPOS(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO EKPOS(EKPSA, EKPMANDANT, EKPAUFKRS, EKPAUFLFD, EKPAUFPOS, EKPAENDST, EKPAENZL, EKPAENB, EKPAEND, EKPNEUB, EKPNEUD, EKPAUFGRP, EKPAUFART, EKPARTGR, EKPKUNDNR, EKPWERK, EKPABT, EKPWAKZ, EKPART, EKPVAR, EKPFARBE, EKPDESS, EKPCOL, EKPBESCH, EKPZUSTAND, EKPGROE, EKPSCHLIGR, EKPSCHLINR, EKPLSART, EKPLSVAR, EKPLSFB, EKPLSDESS, EKPLSCOL, EKPLSBE, EKPLSZUSTAND, EKPLSGROE, EKPLSGRPBEZ, EKPLSARTBEZ, EKPSTKLGV, EKPSTKLGB, EKPPRKZ, EKPPRUEF, EKPMATKOMPDR, EKPPARTIE, EKPSPUL, EKPSPULG, EKPSPULM, EKPVPEINH, EKPAM, EKPZUSAM, EKPHUELSE, EKPKF, EKPFDRES, EKPWI, EKPANZTKB, EKPLOSGR, EKPWIRKGEW, EKPVKUNDNR, EKPVWERK, EKPVABT, EKPVART, EKPVVAR, EKPVFARBE, EKPEKUNDNR, EKPEWERK, EKPEABT, EKPEART, EKPEVAR, EKPEFARBE, EKPEDESS, EKPECOL, EKPEBESCH, EKPEZUSTAND, EKPEGROE, EKPMINLIME, EKPMINLISP, EKPMEEH, EKPMEEHGRP, EKPMEEHFKT, EKPME1, EKPME2, EKPME3, EKPME4, EKPME5, EKPME6, EKPME7, EKPME8, EKPME9, EKPMEO, EKPMEU, EKPSMENGE, EKPWE1, EKPWE2, EKPWE3, EKPWE4, EKPWE5, EKPWE6, EKPWE7, EKPWE8, EKPWE9, EKPBDAT, EKPLTERM, EKPFIX, EKPLDAT, EKPDRUDAT, EKPWVTERM, EKPWUTERM, EKPVEINDAT, EKPVEINDALT, EKPLTERMBE, EKPLTERMKZ, EKPVTERMIN, EKPVTERMEIN, EKPDATVON, EKPBEDAT, EKPTERMTAB, EKPTERMIND, EKPSOLLDAT1, EKPISTDAT1, EKPSOLLDAT2, EKPISTDAT2, EKPSOLLDAT3, EKPISTDAT3, EKPSOLLDAT4, EKPISTDAT4, EKPSOLLDAT5, EKPISTDAT5, EKPSOLLDAT6, EKPISTDAT6, EKPLRUECK, EKPPRME, EKPPREH, EKPPREHGRP, EKPPREHFKT, EKPPRDR, EKPPREISKZ, EKPPREISLST, EKPRABATTKZ, EKPRABATT, EKPRABART1, EKPRABPROZ1, EKPRABWERT1, EKPRABART2, EKPRABPROZ2, EKPRABWERT2, EKPRABART3, EKPRABPROZ3, EKPRABWERT3, EKPRABART4, EKPRABPROZ4, EKPRABWERT4, EKPRABART5, EKPRABPROZ5, EKPRABWERT5, EKPZUAB1, EKPZUABPR1, EKPZUABWE1, EKPZUABME1, EKPABRKZ1, EKPZUAB2, EKPZUABPR2, EKPZUABWE2, EKPZUABME2, EKPABRKZ2, EKPZUAB3, EKPZUABPR3, EKPZUABWE3, EKPZUABME3, EKPABRKZ3, EKPZUAB4, EKPZUABPR4, EKPZUABWE4, EKPZUABME4, EKPABRKZ4, EKPZUAB5, EKPZUABPR5, EKPZUABWE5, EKPZUABME5, EKPABRKZ5, EKPZUABWERT, EKPFIXBONP, EKPFIXBONA, EKPKALBONP, EKPKALBONA, EKPCOUPON, EKPKOKRS, EKPKOLFD, EKPKOPOS, EKPSTA, EKPSTAKZ, EKPMAHNKZ, EKPMAHNKZA, EKPMAHNDAT, EKPKTOKL4, EKPKSTKRS, EKPKST, EKPBUDGET, EKPINVAUF, EKPFAUFTYP, EKPFAUFKRS, EKPFAUFLFD, EKPFAUFPOS, EKPANRKR, EKPALFDNR, EKPWAEHRSL, EKPKURS, EKPBETRAG, EKPHWAEHRSL, EKPHEUROKURS, EKPHEUROKURSVK, EKPFEUROKURS, EKPFEUROKURSVK, EKPTERMNR, EKPFAELLIG, EKPSICHER, EKPSICHP, EKPAKKRED, EKPUDATUM, EKPUAENZL, EKPUAENB, EKPLIEFNR, EKPKONDSL, EKPLO, EKPLB, EKPLPLATZ, EKPLIEFERSCH, EKPZOLLSL, EKPIMEXSL, EKPKNTRNRL, EKPLIEFKOMP, EKPABRUF, EKPSACHB, EKPLEBKZ, EKPSPERR, EKPWIEBEST, EKPBEKZ, EKPPOSTYP, EKPGESSTA, EKPEINSTA, EKPZENSUR, EKPTEXTKON, EKPMCODE, EKPGENBENID1, EKPGENDAT1, EKPGENBENID2, EKPGENDAT2, EKPGENBENID3, EKPGENDAT3, EKPGENSTUFE, EKPGENOFFEN, EKPABLADEST, EKPVERBENID, EKPWEMAIL, EKPURLAND, EKPETIDR, EKPCHAR, EKPGNR, EKPZUARTF, EKPZUABPRF, EKPZUABWEF, EKPMEEHF, EKPABRKZF, EKPZUARTV, EKPZUABPRV, EKPZUABWEV, EKPMEEHV, EKPABRKZV, EKPVERSICH, EKPEDIKZ, EKPKOMMNR, EKPKOMMPOS, EKPEDIDAT, EKPEDIZEIT, EKPURBESTPOS, EKPVERTRNRK, EKPVERTRPOSK, EKPTERMSTA, EKPKONTSTA, EKPZUABSTA, EKPEXMANDANT, EKPWVTERMVG, EKPFILLER14)"
            + " VALUES ('PO', :EKPMANDANT, :EKPAUFKRS, :EKPAUFLFD, :EKPAUFPOS, '000', 1, 'INTEXE  ', 20130808, 'INTEXE  ', 20130808, 'B', 'BE', '8', '        ', '   ', '   ', ' ', '3030303030303030303030303031202020202020', '303030', '20202020202020202020', '          ', '          ', '          ', '    ', '       ', '     ', '000000000000000', '                    ', '   ', '          ', '          ', '          ', '          ', '    ', '       ', '                    ', '                ', 0, 0, ' ', '    ', 'J', '       ', 0, 0, 0, '    ', '  ', '  ', '      ', ' ', ' ', ' ', 0, 0, 0, '        ', '   ', '   ', '2020202020202020202020202020202020202020', '202020', '20202020202020202020', '        ', '   ', '   ', '                    ', '   ', '          ', '          ', '          ', '          ', '    ', '       ', 0, 0, 'KG ', '4', '000001000000', 123400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234000, 0, 0, 0, 0, 0, 0, 0, 0, 20081111, 20130808, ' ', '08.08.13', 0, 20130920, 20130808, 20130927, 20130808, 0, ' ', 0, '        ', 0, 0, 'POS ', 0, 20130920, 0, 20130927, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0000010000', 'KG ', '4', '000001000000', 'J', 'N.', '     ', ' ', 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', 0, 0, 0, 0, 0, ' ', '  ', '      ', '   ', '  ', 'I', '  ', '  ', 0, '000000', '  ', '0000', '        ', '00000000', ' ', '  ', '000000', '000', '  ', '000000', 'RMB', 10000, 1, 'RMB', 0, ' ', 0, ' ', 0, 0, '0', 0, '               ', 0, 0, '        ', '00009003', 'STD ', '01', '  ', '        ', '        ', ' ', ' ', '               ', ' ', ' ', 'JANE    ', ' ', ' ', '        ', ' ', '   ', '  ', '10', ' ', '              ', '              ', '        ', 0, '        ', 0, '        ', 0, 0, '        ', '    ', '        ', ' ', '   ', ' ', 0, 0, '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', 0, ' ', '                    ', '0000', 0, 0, '000', '                    ', '0000', '20', '30', '40', '  ', ' ', '00000000               00000000 00000000       000000000                ')";
            or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
            or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
            or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
            or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
            Connect2Proxy(or1);
        }
        public void DeleteEKPOS(string client, string krs, string lfd, string pos)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE EKPOS "
            + " WHERE EKPMANDANT=:EKPMANDANT   AND EKPAUFKRS=:EKPAUFKRS  AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
            or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = krs;
            or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = lfd;
            or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = pos;
            Connect2Proxy(or1);
        }
        public void UpdateEKPOS(DataRow dwData, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region============Command==============
                    or1.CommandText = "UPDATE EKPOS SET "
+ "EKPSA=:EKPSA,"
+ "EKPMANDANT=:EKPMANDANT,"
+ "E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+ "EKPPREH=:EKPPREH,"
+ "EKPPREHGRP=:EKPPREHGRP,"
+ "EKPPREHFKT=:EKPPREHFKT,"
+ "EKPPRDR=:EKPPRDR,"
+ "EKPPREISKZ=:EKPPREISKZ,"
+ "EKPPREISLST=:EKPPREISLST,"
+ "EKPRABATTKZ=:EKPRABATTKZ,"
+ "EKPRABATT=:EKPRABATT,"
+ "EKPRABART1=:EKPRABART1,"
+ "EKPRABPROZ1=:EKPRABPROZ1,"
+ "EKPRABWERT1=:EKPRABWERT1,"
+ "EKPRABART2=:EKPRABART2,"
+ "EKPRABPROZ2=:EKPRABPROZ2,"
+ "EKPRABWERT2=:EKPRABWERT2,"
+ "EKPRABART3=:EKPRABART3,"
+ "EKPRABPROZ3=:EKPRABPROZ3,"
+ "EKPRABWERT3=:EKPRABWERT3,"
+ "EKPRABART4=:EKPRABART4,"
+ "EKPRABPROZ4=:EKPRABPROZ4,"
+ "EKPRABWERT4=:EKPRABWERT4,"
+ "EKPRABART5=:EKPRABART5,"
+ "EKPRABPROZ5=:EKPRABPROZ5,"
+ "EKPRABWERT5=:EKPRABWERT5,"
+ "EKPZUAB1=:EKPZUAB1,"
+ "EKPZUABPR1=:EKPZUABPR1,"
+ "EKPZUABWE1=:EKPZUABWE1,"
+ "EKPZUABME1=:EKPZUABME1,"
+ "EKPABRKZ1=:EKPABRKZ1,"
+ "EKPZUAB2=:EKPZUAB2,"
+ "EKPZUABPR2=:EKPZUABPR2,"
+ "EKPZUABWE2=:EKPZUABWE2,"
+ "EKPZUABME2=:EKPZUABME2,"
+ "EKPABRKZ2=:EKPABRKZ2,"
+ "EKPZUAB3=:EKPZUAB3,"
+ "EKPZUABPR3=:EKPZUABPR3,"
+ "EKPZUABWE3=:EKPZUABWE3,"
+ "EKPZUABME3=:EKPZUABME3,"
+ "EKPABRKZ3=:EKPABRKZ3,"
+ "EKPZUAB4=:EKPZUAB4,"
+ "EKPZUABPR4=:EKPZUABPR4,"
+ "EKPZUABWE4=:EKPZUABWE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KPURLAND=:EKPURLAND,"
+ "EKPETIDR=:EKPETIDR,"
+ "EKPCHAR=:EKPCHAR,"
+ "EKPGNR=:EKPGNR,"
+ "EKPZUARTF=:EKPZUARTF,"
+ "EKPZUABPRF=:EKPZUABPRF,"
+ "EKPZUABWEF=:EKPZUABWEF,"
+ "EKPMEEHF=:EKPMEEHF,"
+ "EKPABRKZF=:EKPABRKZF,"
+ "EKPZUARTV=:EKPZUARTV,"
+ "EKPZUABPRV=:EKPZUABPRV,"
+ "EKPZUABWEV=:EKPZUABWEV,"
+ "EKPMEEHV=:EKPMEEHV,"
+ "EKPABRKZV=:EKPABRKZV,"
+ "EKPVERSICH=:EKPVERSICH,"
+ "EKPEDIKZ=:EKPEDIKZ,"
+ "EKPKOMMNR=:EKPKOMMNR,"
+ "EKPKOMMPOS=:EKPKOMMPOS,"
+ "EKPEDIDAT=:EKPEDIDAT,"
+ "EKPEDIZEIT=:EKPEDIZEIT,"
+ "EKPURBESTPOS=:EKPURBESTPOS,"
+ "EKPVERTRNRK=:EKPVERTRNRK,"
+ "EKPVERTRPOSK=:EKPVERTRPOSK,"
+ "EKPTERMSTA=:EKPTERMSTA,"
+ "EKPKONTSTA=:EKPKONTSTA,"
+ "EKPZUABSTA=:EKPZUABSTA,"
+ "EKPEXMANDANT=:EKPEXMANDANT,"
+ "EKPWVTERMVG=:EKPWVTERMVG,"
+ "EKPFILLER14=:EKPFILLER14 "
+ " WHERE  "
+ "  EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
                    #endregion
                    #region============Parameters==============
                    or1.Parameters.Add("EKPSA", OracleType.NVarChar).Value = dwData["EKPSA"].ToString();
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    or1.Parameters.Add("EKPAENDST", OracleType.NVarChar).Value = dwData["EKPAENDST"].ToString();
                    or1.Parameters.Add("EKPAENZL", OracleType.NVarChar).Value = dwData["EKPAENZL"].ToString();
                    or1.Parameters.Add("EKPAENB", OracleType.NVarChar).Value = dwData["EKPAENB"].ToString();
                    or1.Parameters.Add("EKPAEND", OracleType.NVarChar).Value = dwData["EKPAEND"].ToString();
                    or1.Parameters.Add("EKPNEUB", OracleType.NVarChar).Value = dwData["EKPNEUB"].ToString();
                    or1.Parameters.Add("EKPNEUD", OracleType.NVarChar).Value = dwData["EKPNEUD"].ToString();
                    or1.Parameters.Add("EKPAUFGRP", OracleType.NVarChar).Value = dwData["EKPAUFGRP"].ToString();
                    or1.Parameters.Add("EKPAUFART", OracleType.NVarChar).Value = dwData["EKPAUFART"].ToString();
                    or1.Parameters.Add("EKPARTGR", OracleType.NVarChar).Value = dwData["EKPARTGR"].ToString();
                    or1.Parameters.Add("EKPKUNDNR", OracleType.NVarChar).Value = dwData["EKPKUNDNR"].ToString();
                    or1.Parameters.Add("EKPWERK", OracleType.NVarChar).Value = dwData["EKPWERK"].ToString();
                    or1.Parameters.Add("EKPABT", OracleType.NVarChar).Value = dwData["EKPABT"].ToString();
                    or1.Parameters.Add("EKPWAKZ", OracleType.NVarChar).Value = dwData["EKPWAKZ"].ToString();
                    or1.Parameters.Add("EKPART", OracleType.NVarChar).Value = dwData["EKPART"].ToString();
                    or1.Parameters.Add("EKPVAR", OracleType.NVarChar).Value = dwData["EKPVAR"].ToString();
                    or1.Parameters.Add("EKPFARBE", OracleType.NVarChar).Value = dwData["EKPFARBE"].ToString();
                    or1.Parameters.Add("EKPDESS", OracleType.NVarChar).Value = dwData["EKPDESS"].ToString();
                    or1.Parameters.Add("EKPCOL", OracleType.NVarChar).Value = dwData["EKPCOL"].ToString();
                    or1.Parameters.Add("EKPBESCH", OracleType.NVarChar).Value = dwData["EKPBESCH"].ToString();
                    or1.Parameters.Add("EKPZUSTAND", OracleType.NVarChar).Value = dwData["EKPZUSTAND"].ToString();
                    or1.Parameters.Add("EKPGROE", OracleType.NVarChar).Value = dwData["EKPGROE"].ToString();
                    or1.Parameters.Add("EKPSCHLIGR", OracleType.NVarChar).Value = dwData["EKPSCHLIGR"].ToString();
                    or1.Parameters.Add("EKPSCHLINR", OracleType.NVarChar).Value = dwData["EKPSCHLINR"].ToString();
                    or1.Parameters.Add("EKPLSART", OracleType.NVarChar).Value = dwData["EKPLSART"].ToString();
                    or1.Parameters.Add("EKPLSVAR", OracleType.NVarChar).Value = dwData["EKPLSVAR"].ToString();
                    or1.Parameters.Add("EKPLSFB", OracleType.NVarChar).Value = dwData["EKPLSFB"].ToString();
                    or1.Parameters.Add("EKPLSDESS", OracleType.NVarChar).Value = dwData["EKPLSDESS"].ToString();
                    or1.Parameters.Add("EKPLSCOL", OracleType.NVarChar).Value = dwData["EKPLSCOL"].ToString();
                    or1.Parameters.Add("EKPLSBE", OracleType.NVarChar).Value = dwData["EKPLSBE"].ToString();
                    or1.Parameters.Add("EKPLSZUSTAND", OracleType.NVarChar).Value = dwData["EKPLSZUSTAND"].ToString();
                    or1.Parameters.Add("EKPLSGROE", OracleType.NVarChar).Value = dwData["EKPLSGROE"].ToString();
                    or1.Parameters.Add("EKPLSGRPBEZ", OracleType.NVarChar).Value = dwData["EKPLSGRPBEZ"].ToString();
                    or1.Parameters.Add("EKPLSARTBEZ", OracleType.NVarChar).Value = dwData["EKPLSARTBEZ"].ToString();
                    or1.Parameters.Add("EKPSTKLGV", OracleType.NVarChar).Value = dwData["EKPSTKLGV"].ToString();
                    or1.Parameters.Add("EKPSTKLGB", OracleType.NVarChar).Value = dwData["EKPSTKLGB"].ToString();
                    or1.Parameters.Add("EKPPRKZ", OracleType.NVarChar).Value = dwData["EKPPRKZ"].ToString();
                    or1.Parameters.Add("EKPPRUEF", OracleType.NVarChar).Value = dwData["EKPPRUEF"].ToString();
                    or1.Parameters.Add("EKPMATKOMPDR", OracleType.NVarChar).Value = dwData["EKPMATKOMPDR"].ToString();
                    or1.Parameters.Add("EKPPARTIE", OracleType.NVarChar).Value = dwData["EKPPARTIE"].ToString();
                    or1.Parameters.Add("EKPSPUL", OracleType.NVarChar).Value = dwData["EKPSPUL"].ToString();
                    or1.Parameters.Add("EKPSPULG", OracleType.NVarChar).Value = dwData["EKPSPULG"].ToString();
                    or1.Parameters.Add("EKPSPULM", OracleType.NVarChar).Value = dwData["EKPSPULM"].ToString();
                    or1.Parameters.Add("EKPVPEINH", OracleType.NVarChar).Value = dwData["EKPVPEINH"].ToString();
                    or1.Parameters.Add("EKPAM", OracleType.NVarChar).Value = dwData["EKPAM"].ToString();
                    or1.Parameters.Add("EKPZUSAM", OracleType.NVarChar).Value = dwData["EKPZUSAM"].ToString();
                    or1.Parameters.Add("EKPHUELSE", OracleType.NVarChar).Value = dwData["EKPHUELSE"].ToString();
                    or1.Parameters.Add("EKPKF", OracleType.NVarChar).Value = dwData["EKPKF"].ToString();
                    or1.Parameters.Add("EKPFDRES", OracleType.NVarChar).Value = dwData["EKPFDRES"].ToString();
                    or1.Parameters.Add("EKPWI", OracleType.NVarChar).Value = dwData["EKPWI"].ToString();
                    or1.Parameters.Add("EKPANZTKB", OracleType.NVarChar).Value = dwData["EKPANZTKB"].ToString();
                    or1.Parameters.Add("EKPLOSGR", OracleType.NVarChar).Value = dwData["EKPLOSGR"].ToString();
                    or1.Parameters.Add("EKPWIRKGEW", OracleType.NVarChar).Value = dwData["EKPWIRKGEW"].ToString();
                    or1.Parameters.Add("EKPVKUNDNR", OracleType.NVarChar).Value = dwData["EKPVKUNDNR"].ToString();
                    or1.Parameters.Add("EKPVWERK", OracleType.NVarChar).Value = dwData["EKPVWERK"].ToString();
                    or1.Parameters.Add("EKPVABT", OracleType.NVarChar).Value = dwData["EKPVABT"].ToString();
                    or1.Parameters.Add("EKPVART", OracleType.NVarChar).Value = dwData["EKPVART"].ToString();
                    or1.Parameters.Add("EKPVVAR", OracleType.NVarChar).Value = dwData["EKPVVAR"].ToString();
                    or1.Parameters.Add("EKPVFARBE", OracleType.NVarChar).Value = dwData["EKPVFARBE"].ToString();
                    or1.Parameters.Add("EKPEKUNDNR", OracleType.NVarChar).Value = dwData["EKPEKUNDNR"].ToString();
                    or1.Parameters.Add("EKPEWERK", OracleType.NVarChar).Value = dwData["EKPEWERK"].ToString();
                    or1.Parameters.Add("EKPEABT", OracleType.NVarChar).Value = dwData["EKPEABT"].ToString();
                    or1.Parameters.Add("EKPEART", OracleType.NVarChar).Value = dwData["EKPEART"].ToString();
                    or1.Parameters.Add("EKPEVAR", OracleType.NVarChar).Value = dwData["EKPEVAR"].ToString();
                    or1.Parameters.Add("EKPEFARBE", OracleType.NVarChar).Value = dwData["EKPEFARBE"].ToString();
                    or1.Parameters.Add("EKPEDESS", OracleType.NVarChar).Value = dwData["EKPEDESS"].ToString();
                    or1.Parameters.Add("EKPECOL", OracleType.NVarChar).Value = dwData["EKPECOL"].ToString();
                    or1.Parameters.Add("EKPEBESCH", OracleType.NVarChar).Value = dwData["EKPEBESCH"].ToString();
                    or1.Parameters.Add("EKPEZUSTAND", OracleType.NVarChar).Value = dwData["EKPEZUSTAND"].ToString();
                    or1.Parameters.Add("EKPEGROE", OracleType.NVarChar).Value = dwData["EKPEGROE"].ToString();
                    or1.Parameters.Add("EKPMINLIME", OracleType.NVarChar).Value = dwData["EKPMINLIME"].ToString();
                    or1.Parameters.Add("EKPMINLISP", OracleType.NVarChar).Value = dwData["EKPMINLISP"].ToString();
                    or1.Parameters.Add("EKPMEEH", OracleType.NVarChar).Value = dwData["EKPMEEH"].ToString();
                    or1.Parameters.Add("EKPMEEHGRP", OracleType.NVarChar).Value = dwData["EKPMEEHGRP"].ToString();
                    or1.Parameters.Add("EKPMEEHFKT", OracleType.NVarChar).Value = dwData["EKPMEEHFKT"].ToString();
                    or1.Parameters.Add("EKPME1", OracleType.NVarChar).Value = dwData["EKPME1"].ToString();
                    or1.Parameters.Add("EKPME2", OracleType.NVarChar).Value = dwData["EKPME2"].ToString();
                    or1.Parameters.Add("EKPME3", OracleType.NVarChar).Value = dwData["EKPME3"].ToString();
                    or1.Parameters.Add("EKPME4", OracleType.NVarChar).Value = dwData["EKPME4"].ToString();
                    or1.Parameters.Add("EKPME5", OracleType.NVarChar).Value = dwData["EKPME5"].ToString();
                    or1.Parameters.Add("EKPME6", OracleType.NVarChar).Value = dwData["EKPME6"].ToString();
                    or1.Parameters.Add("EKPME7", OracleType.NVarChar).Value = dwData["EKPME7"].ToString();
                    or1.Parameters.Add("EKPME8", OracleType.NVarChar).Value = dwData["EKPME8"].ToString();
                    or1.Parameters.Add("EKPME9", OracleType.NVarChar).Value = dwData["EKPME9"].ToString();
                    or1.Parameters.Add("EKPMEO", OracleType.NVarChar).Value = dwData["EKPMEO"].ToString();
                    or1.Parameters.Add("EKPMEU", OracleType.NVarChar).Value = dwData["EKPMEU"].ToString();
                    or1.Parameters.Add("EKPSMENGE", OracleType.NVarChar).Value = dwData["EKPSMENGE"].ToString();
                    or1.Parameters.Add("EKPWE1", OracleType.NVarChar).Value = dwData["EKPWE1"].ToString();
                    or1.Parameters.Add("EKPWE2", OracleType.NVarChar).Value = dwData["EKPWE2"].ToString();
                    or1.Parameters.Add("EKPWE3", OracleType.NVarChar).Value = dwData["EKPWE3"].ToString();
                    or1.Parameters.Add("EKPWE4", OracleType.NVarChar).Value = dwData["EKPWE4"].ToString();
                    or1.Parameters.Add("EKPWE5", OracleType.NVarChar).Value = dwData["EKPWE5"].ToString();
                    or1.Parameters.Add("EKPWE6", OracleType.NVarChar).Value = dwData["EKPWE6"].ToString();
                    or1.Parameters.Add("EKPWE7", OracleType.NVarChar).Value = dwData["EKPWE7"].ToString();
                    or1.Parameters.Add("EKPWE8", OracleType.NVarChar).Value = dwData["EKPWE8"].ToString();
                    or1.Parameters.Add("EKPWE9", OracleType.NVarChar).Value = dwData["EKPWE9"].ToString();
                    or1.Parameters.Add("EKPBDAT", OracleType.NVarChar).Value = dwData["EKPBDAT"].ToString();
                    or1.Parameters.Add("EKPLTERM", OracleType.NVarChar).Value = dwData["EKPLTERM"].ToString();
                    or1.Parameters.Add("EKPFIX", OracleType.NVarChar).Value = dwData["EKPFIX"].ToString();
                    or1.Parameters.Add("EKPLDAT", OracleType.NVarChar).Value = dwData["EKPLDAT"].ToString();
                    or1.Parameters.Add("EKPDRUDAT", OracleType.NVarChar).Value = dwData["EKPDRUDAT"].ToString();
                    or1.Parameters.Add("EKPWVTERM", OracleType.NVarChar).Value = dwData["EKPWVTERM"].ToString();
                    or1.Parameters.Add("EKPWUTERM", OracleType.NVarChar).Value = dwData["EKPWUTERM"].ToString();
                    or1.Parameters.Add("EKPVEINDAT", OracleType.NVarChar).Value = dwData["EKPVEINDAT"].ToString();
                    or1.Parameters.Add("EKPVEINDALT", OracleType.NVarChar).Value = dwData["EKPVEINDALT"].ToString();
                    or1.Parameters.Add("EKPLTERMBE", OracleType.NVarChar).Value = dwData["EKPLTERMBE"].ToString();
                    or1.Parameters.Add("EKPLTERMKZ", OracleType.NVarChar).Value = dwData["EKPLTERMKZ"].ToString();
                    or1.Parameters.Add("EKPVTERMIN", OracleType.NVarChar).Value = dwData["EKPVTERMIN"].ToString();
                    or1.Parameters.Add("EKPVTERMEIN", OracleType.NVarChar).Value = dwData["EKPVTERMEIN"].ToString();
                    or1.Parameters.Add("EKPDATVON", OracleType.NVarChar).Value = dwData["EKPDATVON"].ToString();
                    or1.Parameters.Add("EKPBEDAT", OracleType.NVarChar).Value = dwData["EKPBEDAT"].ToString();
                    or1.Parameters.Add("EKPTERMTAB", OracleType.NVarChar).Value = dwData["EKPTERMTAB"].ToString();
                    or1.Parameters.Add("EKPTERMIND", OracleType.NVarChar).Value = dwData["EKPTERMIND"].ToString();
                    or1.Parameters.Add("EKPSOLLDAT1", OracleType.NVarChar).Value = dwData["EKPSOLLDAT1"].ToString();
                    or1.Parameters.Add("EKPISTDAT1", OracleType.NVarChar).Value = dwData["EKPISTDAT1"].ToString();
                    or1.Parameters.Add("EKPSOLLDAT2", OracleType.NVarChar).Value = dwData["EKPSOLLDAT2"].ToString();
                    or1.Parameters.Add("EKPISTDAT2", OracleType.NVarChar).Value = dwData["EKPISTDAT2"].ToString();
                    or1.Parameters.Add("EKPSOLLDAT3", OracleType.NVarChar).Value = dwData["EKPSOLLDAT3"].ToString();
                    or1.Parameters.Add("EKPISTDAT3", OracleType.NVarChar).Value = dwData["EKPISTDAT3"].ToString();
                    or1.Parameters.Add("EKPSOLLDAT4", OracleType.NVarChar).Value = dwData["EKPSOLLDAT4"].ToString();
                    or1.Parameters.Add("EKPISTDAT4", OracleType.NVarChar).Value = dwData["EKPISTDAT4"].ToString();
                    or1.Parameters.Add("EKPSOLLDAT5", OracleType.NVarChar).Value = dwData["EKPSOLLDAT5"].ToString();
                    or1.Parameters.Add("EKPISTDAT5", OracleType.NVarChar).Value = dwData["EKPISTDAT5"].ToString();
                    or1.Parameters.Add("EKPSOLLDAT6", OracleType.NVarChar).Value = dwData["EKPSOLLDAT6"].ToString();
                    or1.Parameters.Add("EKPISTDAT6", OracleType.NVarChar).Value = dwData["EKPISTDAT6"].ToString();
                    or1.Parameters.Add("EKPLRUECK", OracleType.NVarChar).Value = dwData["EKPLRUECK"].ToString();
                    or1.Parameters.Add("EKPPRME", OracleType.NVarChar).Value = dwData["EKPPRME"].ToString();
                    or1.Parameters.Add("EKPPREH", OracleType.NVarChar).Value = dwData["EKPPREH"].ToString();
                    or1.Parameters.Add("EKPPREHGRP", OracleType.NVarChar).Value = dwData["EKPPREHGRP"].ToString();
                    or1.Parameters.Add("EKPPREHFKT", OracleType.NVarChar).Value = dwData["EKPPREHFKT"].ToString();
                    or1.Parameters.Add("EKPPRDR", OracleType.NVarChar).Value = dwData["EKPPRDR"].ToString();
                    or1.Parameters.Add("EKPPREISKZ", OracleType.NVarChar).Value = dwData["EKPPREISKZ"].ToString();
                    or1.Parameters.Add("EKPPREISLST", OracleType.NVarChar).Value = dwData["EKPPREISLST"].ToString();
                    or1.Parameters.Add("EKPRABATTKZ", OracleType.NVarChar).Value = dwData["EKPRABATTKZ"].ToString();
                    or1.Parameters.Add("EKPRABATT", OracleType.NVarChar).Value = dwData["EKPRABATT"].ToString();
                    or1.Parameters.Add("EKPRABART1", OracleType.NVarChar).Value = dwData["EKPRABART1"].ToString();
                    or1.Parameters.Add("EKPRABPROZ1", OracleType.NVarChar).Value = dwData["EKPRABPROZ1"].ToString();
                    or1.Parameters.Add("EKPRABWERT1", OracleType.NVarChar).Value = dwData["EKPRABWERT1"].ToString();
                    or1.Parameters.Add("EKPRABART2", OracleType.NVarChar).Value = dwData["EKPRABART2"].ToString();
                    or1.Parameters.Add("EKPRABPROZ2", OracleType.NVarChar).Value = dwData["EKPRABPROZ2"].ToString();
                    or1.Parameters.Add("EKPRABWERT2", OracleType.NVarChar).Value = dwData["EKPRABWERT2"].ToString();
                    or1.Parameters.Add("EKPRABART3", OracleType.NVarChar).Value = dwData["EKPRABART3"].ToString();
                    or1.Parameters.Add("EKPRABPROZ3", OracleType.NVarChar).Value = dwData["EKPRABPROZ3"].ToString();
                    or1.Parameters.Add("EKPRABWERT3", OracleType.NVarChar).Value = dwData["EKPRABWERT3"].ToString();
                    or1.Parameters.Add("EKPRABART4", OracleType.NVarChar).Value = dwData["EKPRABART4"].ToString();
                    or1.Parameters.Add("EKPRABPROZ4", OracleType.NVarChar).Value = dwData["EKPRABPROZ4"].ToString();
                    or1.Parameters.Add("EKPRABWERT4", OracleType.NVarChar).Value = dwData["EKPRABWERT4"].ToString();
                    or1.Parameters.Add("EKPRABART5", OracleType.NVarChar).Value = dwData["EKPRABART5"].ToString();
                    or1.Parameters.Add("EKPRABPROZ5", OracleType.NVarChar).Value = dwData["EKPRABPROZ5"].ToString();
                    or1.Parameters.Add("EKPRABWERT5", OracleType.NVarChar).Value = dwData["EKPRABWERT5"].ToString();
                    or1.Parameters.Add("EKPZUAB1", OracleType.NVarChar).Value = dwData["EKPZUAB1"].ToString();
                    or1.Parameters.Add("EKPZUABPR1", OracleType.NVarChar).Value = dwData["EKPZUABPR1"].ToString();
                    or1.Parameters.Add("EKPZUABWE1", OracleType.NVarChar).Value = dwData["EKPZUABWE1"].ToString();
                    or1.Parameters.Add("EKPZUABME1", OracleType.NVarChar).Value = dwData["EKPZUABME1"].ToString();
                    or1.Parameters.Add("EKPABRKZ1", OracleType.NVarChar).Value = dwData["EKPABRKZ1"].ToString();
                    or1.Parameters.Add("EKPZUAB2", OracleType.NVarChar).Value = dwData["EKPZUAB2"].ToString();
                    or1.Parameters.Add("EKPZUABPR2", OracleType.NVarChar).Value = dwData["EKPZUABPR2"].ToString();
                    or1.Parameters.Add("EKPZUABWE2", OracleType.NVarChar).Value = dwData["EKPZUABWE2"].ToString();
                    or1.Parameters.Add("EKPZUABME2", OracleType.NVarChar).Value = dwData["EKPZUABME2"].ToString();
                    or1.Parameters.Add("EKPABRKZ2", OracleType.NVarChar).Value = dwData["EKPABRKZ2"].ToString();
                    or1.Parameters.Add("EKPZUAB3", OracleType.NVarChar).Value = dwData["EKPZUAB3"].ToString();
                    or1.Parameters.Add("EKPZUABPR3", OracleType.NVarChar).Value = dwData["EKPZUABPR3"].ToString();
                    or1.Parameters.Add("EKPZUABWE3", OracleType.NVarChar).Value = dwData["EKPZUABWE3"].ToString();
                    or1.Parameters.Add("EKPZUABME3", OracleType.NVarChar).Value = dwData["EKPZUABME3"].ToString();
                    or1.Parameters.Add("EKPABRKZ3", OracleType.NVarChar).Value = dwData["EKPABRKZ3"].ToString();
                    or1.Parameters.Add("EKPZUAB4", OracleType.NVarChar).Value = dwData["EKPZUAB4"].ToString();
                    or1.Parameters.Add("EKPZUABPR4", OracleType.NVarChar).Value = dwData["EKPZUABPR4"].ToString();
                    or1.Parameters.Add("EKPZUABWE4", OracleType.NVarChar).Value = dwData["EKPZUABWE4"].ToString();
                    or1.Parameters.Add("EKPZUABME4", OracleType.NVarChar).Value = dwData["EKPZUABME4"].ToString();
                    or1.Parameters.Add("EKPABRKZ4", OracleType.NVarChar).Value = dwData["EKPABRKZ4"].ToString();
                    or1.Parameters.Add("EKPZUAB5", OracleType.NVarChar).Value = dwData["EKPZUAB5"].ToString();
                    or1.Parameters.Add("EKPZUABPR5", OracleType.NVarChar).Value = dwData["EKPZUABPR5"].ToString();
                    or1.Parameters.Add("EKPZUABWE5", OracleType.NVarChar).Value = dwData["EKPZUABWE5"].ToString();
                    or1.Parameters.Add("EKPZUABME5", OracleType.NVarChar).Value = dwData["EKPZUABME5"].ToString();
                    or1.Parameters.Add("EKPABRKZ5", OracleType.NVarChar).Value = dwData["EKPABRKZ5"].ToString();
                    or1.Parameters.Add("EKPZUABWERT", OracleType.NVarChar).Value = dwData["EKPZUABWERT"].ToString();
                    or1.Parameters.Add("EKPFIXBONP", OracleType.NVarChar).Value = dwData["EKPFIXBONP"].ToString();
                    or1.Parameters.Add("EKPFIXBONA", OracleType.NVarChar).Value = dwData["EKPFIXBONA"].ToString();
                    or1.Parameters.Add("EKPKALBONP", OracleType.NVarChar).Value = dwData["EKPKALBONP"].ToString();
                    or1.Parameters.Add("EKPKALBONA", OracleType.NVarChar).Value = dwData["EKPKALBONA"].ToString();
                    or1.Parameters.Add("EKPCOUPON", OracleType.NVarChar).Value = dwData["EKPCOUPON"].ToString();
                    or1.Parameters.Add("EKPKOKRS", OracleType.NVarChar).Value = dwData["EKPKOKRS"].ToString();
                    or1.Parameters.Add("EKPKOLFD", OracleType.NVarChar).Value = dwData["EKPKOLFD"].ToString();
                    or1.Parameters.Add("EKPKOPOS", OracleType.NVarChar).Value = dwData["EKPKOPOS"].ToString();
                    or1.Parameters.Add("EKPSTA", OracleType.NVarChar).Value = dwData["EKPSTA"].ToString();
                    or1.Parameters.Add("EKPSTAKZ", OracleType.NVarChar).Value = dwData["EKPSTAKZ"].ToString();
                    or1.Parameters.Add("EKPMAHNKZ", OracleType.NVarChar).Value = dwData["EKPMAHNKZ"].ToString();
                    or1.Parameters.Add("EKPMAHNKZA", OracleType.NVarChar).Value = dwData["EKPMAHNKZA"].ToString();
                    or1.Parameters.Add("EKPMAHNDAT", OracleType.NVarChar).Value = dwData["EKPMAHNDAT"].ToString();
                    or1.Parameters.Add("EKPKTOKL4", OracleType.NVarChar).Value = dwData["EKPKTOKL4"].ToString();
                    or1.Parameters.Add("EKPKSTKRS", OracleType.NVarChar).Value = dwData["EKPKSTKRS"].ToString();
                    or1.Parameters.Add("EKPKST", OracleType.NVarChar).Value = dwData["EKPKST"].ToString();
                    or1.Parameters.Add("EKPBUDGET", OracleType.NVarChar).Value = dwData["EKPBUDGET"].ToString();
                    or1.Parameters.Add("EKPINVAUF", OracleType.NVarChar).Value = dwData["EKPINVAUF"].ToString();
                    or1.Parameters.Add("EKPFAUFTYP", OracleType.NVarChar).Value = dwData["EKPFAUFTYP"].ToString();
                    or1.Parameters.Add("EKPFAUFKRS", OracleType.NVarChar).Value = dwData["EKPFAUFKRS"].ToString();
                    or1.Parameters.Add("EKPFAUFLFD", OracleType.NVarChar).Value = dwData["EKPFAUFLFD"].ToString();
                    or1.Parameters.Add("EKPFAUFPOS", OracleType.NVarChar).Value = dwData["EKPFAUFPOS"].ToString();
                    or1.Parameters.Add("EKPANRKR", OracleType.NVarChar).Value = dwData["EKPANRKR"].ToString();
                    or1.Parameters.Add("EKPALFDNR", OracleType.NVarChar).Value = dwData["EKPALFDNR"].ToString();
                    or1.Parameters.Add("EKPWAEHRSL", OracleType.NVarChar).Value = dwData["EKPWAEHRSL"].ToString();
                    or1.Parameters.Add("EKPKURS", OracleType.NVarChar).Value = dwData["EKPKURS"].ToString();
                    or1.Parameters.Add("EKPBETRAG", OracleType.NVarChar).Value = dwData["EKPBETRAG"].ToString();
                    or1.Parameters.Add("EKPHWAEHRSL", OracleType.NVarChar).Value = dwData["EKPHWAEHRSL"].ToString();
                    or1.Parameters.Add("EKPHEUROKURS", OracleType.NVarChar).Value = dwData["EKPHEUROKURS"].ToString();
                    or1.Parameters.Add("EKPHEUROKURSVK", OracleType.NVarChar).Value = dwData["EKPHEUROKURSVK"].ToString();
                    or1.Parameters.Add("EKPFEUROKURS", OracleType.NVarChar).Value = dwData["EKPFEUROKURS"].ToString();
                    or1.Parameters.Add("EKPFEUROKURSVK", OracleType.NVarChar).Value = dwData["EKPFEUROKURSVK"].ToString();
                    or1.Parameters.Add("EKPTERMNR", OracleType.NVarChar).Value = dwData["EKPTERMNR"].ToString();
                    or1.Parameters.Add("EKPFAELLIG", OracleType.NVarChar).Value = dwData["EKPFAELLIG"].ToString();
                    or1.Parameters.Add("EKPSICHER", OracleType.NVarChar).Value = dwData["EKPSICHER"].ToString();
                    or1.Parameters.Add("EKPSICHP", OracleType.NVarChar).Value = dwData["EKPSICHP"].ToString();
                    or1.Parameters.Add("EKPAKKRED", OracleType.NVarChar).Value = dwData["EKPAKKRED"].ToString();
                    or1.Parameters.Add("EKPUDATUM", OracleType.NVarChar).Value = dwData["EKPUDATUM"].ToString();
                    or1.Parameters.Add("EKPUAENZL", OracleType.NVarChar).Value = dwData["EKPUAENZL"].ToString();
                    or1.Parameters.Add("EKPUAENB", OracleType.NVarChar).Value = dwData["EKPUAENB"].ToString();
                    or1.Parameters.Add("EKPLIEFNR", OracleType.NVarChar).Value = dwData["EKPLIEFNR"].ToString();
                    or1.Parameters.Add("EKPKONDSL", OracleType.NVarChar).Value = dwData["EKPKONDSL"].ToString();
                    or1.Parameters.Add("EKPLO", OracleType.NVarChar).Value = dwData["EKPLO"].ToString();
                    or1.Parameters.Add("EKPLB", OracleType.NVarChar).Value = dwData["EKPLB"].ToString();
                    or1.Parameters.Add("EKPLPLATZ", OracleType.NVarChar).Value = dwData["EKPLPLATZ"].ToString();
                    or1.Parameters.Add("EKPLIEFERSCH", OracleType.NVarChar).Value = dwData["EKPLIEFERSCH"].ToString();
                    or1.Parameters.Add("EKPZOLLSL", OracleType.NVarChar).Value = dwData["EKPZOLLSL"].ToString();
                    or1.Parameters.Add("EKPIMEXSL", OracleType.NVarChar).Value = dwData["EKPIMEXSL"].ToString();
                    or1.Parameters.Add("EKPKNTRNRL", OracleType.NVarChar).Value = dwData["EKPKNTRNRL"].ToString();
                    or1.Parameters.Add("EKPLIEFKOMP", OracleType.NVarChar).Value = dwData["EKPLIEFKOMP"].ToString();
                    or1.Parameters.Add("EKPABRUF", OracleType.NVarChar).Value = dwData["EKPABRUF"].ToString();
                    or1.Parameters.Add("EKPSACHB", OracleType.NVarChar).Value = dwData["EKPSACHB"].ToString();
                    or1.Parameters.Add("EKPLEBKZ", OracleType.NVarChar).Value = dwData["EKPLEBKZ"].ToString();
                    or1.Parameters.Add("EKPSPERR", OracleType.NVarChar).Value = dwData["EKPSPERR"].ToString();
                    or1.Parameters.Add("EKPWIEBEST", OracleType.NVarChar).Value = dwData["EKPWIEBEST"].ToString();
                    or1.Parameters.Add("EKPBEKZ", OracleType.NVarChar).Value = dwData["EKPBEKZ"].ToString();
                    or1.Parameters.Add("EKPPOSTYP", OracleType.NVarChar).Value = dwData["EKPPOSTYP"].ToString();
                    or1.Parameters.Add("EKPGESSTA", OracleType.NVarChar).Value = dwData["EKPGESSTA"].ToString();
                    or1.Parameters.Add("EKPEINSTA", OracleType.NVarChar).Value = dwData["EKPEINSTA"].ToString();
                    or1.Parameters.Add("EKPZENSUR", OracleType.NVarChar).Value = dwData["EKPZENSUR"].ToString();
                    or1.Parameters.Add("EKPTEXTKON", OracleType.NVarChar).Value = dwData["EKPTEXTKON"].ToString();
                    or1.Parameters.Add("EKPMCODE", OracleType.NVarChar).Value = dwData["EKPMCODE"].ToString();
                    or1.Parameters.Add("EKPGENBENID1", OracleType.NVarChar).Value = dwData["EKPGENBENID1"].ToString();
                    or1.Parameters.Add("EKPGENDAT1", OracleType.NVarChar).Value = dwData["EKPGENDAT1"].ToString();
                    or1.Parameters.Add("EKPGENBENID2", OracleType.NVarChar).Value = dwData["EKPGENBENID2"].ToString();
                    or1.Parameters.Add("EKPGENDAT2", OracleType.NVarChar).Value = dwData["EKPGENDAT2"].ToString();
                    or1.Parameters.Add("EKPGENBENID3", OracleType.NVarChar).Value = dwData["EKPGENBENID3"].ToString();
                    or1.Parameters.Add("EKPGENDAT3", OracleType.NVarChar).Value = dwData["EKPGENDAT3"].ToString();
                    or1.Parameters.Add("EKPGENSTUFE", OracleType.NVarChar).Value = dwData["EKPGENSTUFE"].ToString();
                    or1.Parameters.Add("EKPGENOFFEN", OracleType.NVarChar).Value = dwData["EKPGENOFFEN"].ToString();
                    or1.Parameters.Add("EKPABLADEST", OracleType.NVarChar).Value = dwData["EKPABLADEST"].ToString();
                    or1.Parameters.Add("EKPVERBENID", OracleType.NVarChar).Value = dwData["EKPVERBENID"].ToString();
                    or1.Parameters.Add("EKPWEMAIL", OracleType.NVarChar).Value = dwData["EKPWEMAIL"].ToString();
                    or1.Parameters.Add("EKPURLAND", OracleType.NVarChar).Value = dwData["EKPURLAND"].ToString();
                    or1.Parameters.Add("EKPETIDR", OracleType.NVarChar).Value = dwData["EKPETIDR"].ToString();
                    or1.Parameters.Add("EKPCHAR", OracleType.NVarChar).Value = dwData["EKPCHAR"].ToString();
                    or1.Parameters.Add("EKPGNR", OracleType.NVarChar).Value = dwData["EKPGNR"].ToString();
                    or1.Parameters.Add("EKPZUARTF", OracleType.NVarChar).Value = dwData["EKPZUARTF"].ToString();
                    or1.Parameters.Add("EKPZUABPRF", OracleType.NVarChar).Value = dwData["EKPZUABPRF"].ToString();
                    or1.Parameters.Add("EKPZUABWEF", OracleType.NVarChar).Value = dwData["EKPZUABWEF"].ToString();
                    or1.Parameters.Add("EKPMEEHF", OracleType.NVarChar).Value = dwData["EKPMEEHF"].ToString();
                    or1.Parameters.Add("EKPABRKZF", OracleType.NVarChar).Value = dwData["EKPABRKZF"].ToString();
                    or1.Parameters.Add("EKPZUARTV", OracleType.NVarChar).Value = dwData["EKPZUARTV"].ToString();
                    or1.Parameters.Add("EKPZUABPRV", OracleType.NVarChar).Value = dwData["EKPZUABPRV"].ToString();
                    or1.Parameters.Add("EKPZUABWEV", OracleType.NVarChar).Value = dwData["EKPZUABWEV"].ToString();
                    or1.Parameters.Add("EKPMEEHV", OracleType.NVarChar).Value = dwData["EKPMEEHV"].ToString();
                    or1.Parameters.Add("EKPABRKZV", OracleType.NVarChar).Value = dwData["EKPABRKZV"].ToString();
                    or1.Parameters.Add("EKPVERSICH", OracleType.NVarChar).Value = dwData["EKPVERSICH"].ToString();
                    or1.Parameters.Add("EKPEDIKZ", OracleType.NVarChar).Value = dwData["EKPEDIKZ"].ToString();
                    or1.Parameters.Add("EKPKOMMNR", OracleType.NVarChar).Value = dwData["EKPKOMMNR"].ToString();
                    or1.Parameters.Add("EKPKOMMPOS", OracleType.NVarChar).Value = dwData["EKPKOMMPOS"].ToString();
                    or1.Parameters.Add("EKPEDIDAT", OracleType.NVarChar).Value = dwData["EKPEDIDAT"].ToString();
                    or1.Parameters.Add("EKPEDIZEIT", OracleType.NVarChar).Value = dwData["EKPEDIZEIT"].ToString();
                    or1.Parameters.Add("EKPURBESTPOS", OracleType.NVarChar).Value = dwData["EKPURBESTPOS"].ToString();
                    or1.Parameters.Add("EKPVERTRNRK", OracleType.NVarChar).Value = dwData["EKPVERTRNRK"].ToString();
                    or1.Parameters.Add("EKPVERTRPOSK", OracleType.NVarChar).Value = dwData["EKPVERTRPOSK"].ToString();
                    or1.Parameters.Add("EKPTERMSTA", OracleType.NVarChar).Value = dwData["EKPTERMSTA"].ToString();
                    or1.Parameters.Add("EKPKONTSTA", OracleType.NVarChar).Value = dwData["EKPKONTSTA"].ToString();
                    or1.Parameters.Add("EKPZUABSTA", OracleType.NVarChar).Value = dwData["EKPZUABSTA"].ToString();
                    or1.Parameters.Add("EKPEXMANDANT", OracleType.NVarChar).Value = dwData["EKPEXMANDANT"].ToString();
                    or1.Parameters.Add("EKPWVTERMVG", OracleType.NVarChar).Value = dwData["EKPWVTERMVG"].ToString();
                    or1.Parameters.Add("EKPFILLER14", OracleType.NVarChar).Value = dwData["EKPFILLER14"].ToString();
                    #endregion
                    break;
                case 2:
                    or1.CommandText = "UPDATE EKPOS SET "
                    + "EKPME1=:EKPME1,"
                    + "EKPPRME=:EKPPRME,"
                    + "EKPBEKZ=:EKPBEKZ,"
                    + "EKPVTERMIN=:EKPVTERMIN,"
                    + "EKPBEDAT=:EKPBEDAT,"
                    + "EKPEART=:EKPEART,"
                    + "EKPEFARBE=:EKPEFARBE,"
                    + "EKPWE1=:EKPWE1"
                    + ",EKPAENB=:EKPAENB"
                    + " WHERE  "
                    + "  EKPSA='PO' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    or1.Parameters.Add("EKPME1", OracleType.NVarChar).Value = dwData["EKPME1"].ToString();
                    or1.Parameters.Add("EKPPRME", OracleType.NVarChar).Value = dwData["EKPPRME"].ToString();
                    or1.Parameters.Add("EKPBEKZ", OracleType.NVarChar).Value = dwData["EKPBEKZ"].ToString();
                    or1.Parameters.Add("EKPVTERMIN", OracleType.NVarChar).Value = dwData["EKPVTERMIN"].ToString();
                    or1.Parameters.Add("EKPBEDAT", OracleType.NVarChar).Value = dwData["EKPBEDAT"].ToString();
                    or1.Parameters.Add("EKPEART", OracleType.NVarChar).Value = dwData["EKPEART"].ToString();
                    or1.Parameters.Add("EKPEFARBE", OracleType.NVarChar).Value = dwData["EKPEFARBE"].ToString();
                    or1.Parameters.Add("EKPWE1", OracleType.NVarChar).Value = dwData["EKPWE1"].ToString();
                    or1.Parameters.Add("EKPAENB", OracleType.NVarChar).Value = dwData["EKPAENB"].ToString();

                    break;
                case 21:
                    or1.CommandText = "UPDATE EKPOS SET EKPAENB=:EKPAENB,EKPWE1 =TRUNC(EKPME1*EKPPRME*0.001+EKPZUABWERT),EKPWE3 = TRUNC(EKPME3*EKPPRME*0.001+EKPME3/EKPME1*EKPZUABWERT)"
                        + " WHERE  "
                    + "  EKPSA='PO' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    or1.Parameters.Add("EKPAENB", OracleType.NVarChar).Value = dwData["EKPAENB"].ToString();
                    break;
                case 3:
                    or1.CommandText = "UPDATE EKPOS SET "
                    + "EKPBEKZ=:EKPBEKZ "
                    + " WHERE  "
                    + "  EKPSA='PO' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    or1.Parameters.Add("EKPBEKZ", OracleType.NVarChar).Value = dwData["EKPBEKZ"].ToString();
                    break;
                case 4:
                    or1.CommandText = "UPDATE EKPOS SET "
                    + " EKPBEKZ=:EKPBEKZ"
                    + ", EKPKNTRNRL=:EKPKNTRNRL"
                    + " WHERE  "
                    + "  EKPSA='PO' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    or1.Parameters.Add("EKPBEKZ", OracleType.NVarChar).Value = dwData["EKPBEKZ"].ToString();
                    or1.Parameters.Add("EKPKNTRNRL", OracleType.NVarChar).Value = dwData["EKPKNTRNRL"].ToString();
                    break;
                case 5:
                    or1.CommandText = "UPDATE EKPOS SET EKPLIEFNR=:EKPLIEFNR "
                    + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPLIEFNR", OracleType.NVarChar).Value = dwData["EKPLIEFNR"].ToString();
                    break;
                case 6:
                    or1.CommandText = "UPDATE EKPOS SET EKPWIEBEST=:EKPWIEBEST,EKPAENB=''INTEX   "
                    + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    or1.Parameters.Add("EKPWIEBEST", OracleType.NVarChar).Value = dwData["EKPWIEBEST"].ToString();
                    break;
                case 9:
                    or1.CommandText = "UPDATE EKPOS SET EKPLSCOL=:EKPLSCOL WHERE "
                        + "  EKPSA='PO' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    or1.Parameters.Add("EKPLSCOL", OracleType.NVarChar).Value = dwData["EKPLSCOL"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public DataSet QueryEKPOS(string client, string krs, string lfd, int option = 1)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "SELECT * FROM EKPOS WHERE EKPSA<>'AJ' AND  EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD ";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = lfd;
                    break;
                default:
                    break;
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "EKPOS";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryEKPOS(string client, string wakz, string art, string var, string color, int option)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 2://material
                    or1.CommandText = "SELECT * FROM EKPOS WHERE  "
                    + "  EKPSA<>'AJ' AND EKPMANDANT=:EKPMANDANT AND EKPWAKZ=:EKPWAKZ "
                    + " AND utl_raw.cast_to_varchar2(EKPART)=:EKPART AND utl_raw.cast_to_varchar2(EKPVAR)=:EKPVAR  ";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("EKPWAKZ", OracleType.NVarChar).Value = wakz;
                    or1.Parameters.Add("EKPART", OracleType.NVarChar).Value = art;
                    or1.Parameters.Add("EKPVAR", OracleType.NVarChar).Value = var;
                    break;
                default:
                    break;
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "EKPOS";
            }
            setReturn.Merge(Result);
            return setReturn;
        }

        public DataSet QueryEKPOS(DataRow dwData, int option = 1)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            string FSARTPRGR = "";
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM EKPOS WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    or1.CommandText = "SELECT * FROM EKPOS WHERE  "
                    + "  EKPSA<>'AJ'  AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS  ";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString(); ;
                    break;
                case 2:
                    or1.CommandText = "SELECT EKPMANDANT,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,EKPNEUD,EKPNEUB,EKPARTGR,EKPWAKZ,EKPWE1,EKPLTERM,EKPME1,EKPMEEH,EKPPRME"
                     + ",  utl_raw.cast_to_varchar2(EKPART) AS EKPART"
                     + ",  utl_raw.cast_to_varchar2(EKPVAR) AS EKPVAR"
                     + ", utl_raw.cast_to_varchar2(EKPFARBE) AS EKPFARBE,EKPDESS,EKPCOL,EKPGROE "
                    + "  FROM EKPOS P WHERE  "
                    + "  EKPSA<>'AJ' AND EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD ";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    break;
                case 3:
                    or1.CommandText = "SELECT DISTINCT EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,ABAVKAUFPOS,MU.ABAART,MU.ABAVAR,MU.ABAFARBE,"
                    + "ABAGROE,EK.EKPPRME*0.001 AS PRICE,EKPPREH AS UM,WAFGRLFD,EKPME1,EKPME3 FROM EKPOS EK"
                    + " JOIN ICC_ABAUFM MU ON MU.ABAAUFKRS=EK.EKPAUFKRS AND MU.ABAAUFLFD=EK.EKPAUFLFD AND MU.ABAAUFPOS=EK.EKPAUFPOS"
                    + " WHERE EKPSA<>'AJ' AND ABAMANDANT=:ABAMANDANT AND MU.ABAVKAUFKRS=:ABAVKAUFKRS AND MU.ABAVKAUFLFD=:ABAVKAUFLFD ";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = dwData["ABAMANDANT"].ToString();
                    or1.Parameters.Add("ABAVKAUFKRS", OracleType.NVarChar).Value = dwData["ABAVKAUFKRS"].ToString();
                    or1.Parameters.Add("ABAVKAUFLFD", OracleType.NVarChar).Value = dwData["ABAVKAUFLFD"].ToString();
                    break;
                case 4:
                    or1.CommandText = "SELECT DISTINCT EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,ABAVKAUFPOS,MU.ABAART,MU.ABAVAR,MU.ABAFARBE,"
                    + "ABAGROE,EK.EKPPRME*0.001 AS PRICE,EKPPREH AS UM,WAFGRLFD,EKPME1,EKPME3 FROM EKPOS EK"
                    + " JOIN ICC_ABAUFM MU ON MU.ABAAUFKRS=EK.EKPAUFKRS AND MU.ABAAUFLFD=EK.EKPAUFLFD AND MU.ABAAUFPOS=EK.EKPAUFPOS"
                    + " WHERE EKPSA<>'AJ' AND ABAMANDANT=:ABAMANDANT AND MU.ABAVKAUFKRS=:ABAVKAUFKRS AND MU.ABAVKAUFLFD=:ABAVKAUFLFD AND ABAVKAUFPOS=:ABAVKAUFPOS ";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = dwData["ABAMANDANT"].ToString();
                    or1.Parameters.Add("ABAVKAUFKRS", OracleType.NVarChar).Value = dwData["ABAVKAUFKRS"].ToString();
                    or1.Parameters.Add("ABAVKAUFLFD", OracleType.NVarChar).Value = dwData["ABAVKAUFLFD"].ToString();
                    or1.Parameters.Add("ABAVKAUFPOS", OracleType.NVarChar).Value = dwData["ABAVKAUFPOS"].ToString();
                    break;
                case 5:
                    string EKPBEKZ = dwData["EKPBEKZ"].ToString();
                    string EKPKNTRNRL = dwData["EKPKNTRNRL"].ToString();
                    or1.CommandText = "SELECT EKPMANDANT,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,EKPNEUD,EKPNEUB,EKPARTGR, "
                    + " EKPWAKZ,EKPBEKZ,EKPLIEFNR,EKPWE1,EKPLTERM,EKPME1,EKPMEEH,EKPPRME,EKPLSGRPBEZ "
                    + " ,EKPZUAB1,EKPZUABPR1,EKPZUABWE1,EKPZUABME1,EKPABRKZ1,EKPZUAB2,EKPZUABPR2, "
                    + " EKPZUABWE2,EKPZUABME2,EKPABRKZ2,EKPZUAB3,EKPZUABPR3, "
                    + " EKPZUABWE3,EKPZUABME3  ,EKPABRKZ3,EKPZUAB4,EKPZUABPR4,EKPZUABWE4,EKPZUABME4, "
                    + " EKPABRKZ4,EKPZUAB5,EKPZUABPR5,EKPZUABWE5, "
                    + " EKPZUABME5  ,EKPABRKZ5,  EKPZUABWERT,EKPKNTRNRL "
                    + " ,  utl_raw.cast_to_varchar2(EKPART) AS EKPART "
                    + " ,  utl_raw.cast_to_varchar2(EKPVAR) AS EKPVAR "
                    + " , utl_raw.cast_to_varchar2(EKPFARBE) AS EKPFARBE,EKPDESS,EKPCOL,EKPGROE "
                    + "  FROM EKPOS P WHERE EKPSA<>'AJ' AND EKPMANDANT=:EKPMANDANT "
                    + "  AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD"
                    + "  AND EKPBEKZ IN ( " + EKPBEKZ + ")  "
                    + "  AND ( trim(EKPKNTRNRL) IS " + EKPKNTRNRL + " NULL "
                    + "  or EXISTS (SELECT '1' FROM EKVRECH A "
                    + "  WHERE A.EKVMANDANT = P.EKPMANDANT  "
                    + "  AND TRIM(A.EKVFILLER)  = P.EKPAUFKRS||'-'||P.EKPAUFLFD||'-'||P.EKPAUFPOS "
                    + "  AND A.EKVKIR='K'  AND '" + EKPKNTRNRL + "' = 'NOT')) ";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    break;
                case 901:
                    FSARTPRGR = dwData["ABPART"].ToString().Trim();
                    or1.CommandText = "SELECT LSLIEFNA,FSKOLL,FSARTPRGR,SUM(EKPME1*0.01) AS EKPME1,EKPMEEH,SUM(EKPWE1*0.01) AS EKPWE1 FROM EKPOS JOIN"
                    + " (SELECT DISTINCT ABAMANDANT,ABPART,FSARTPRGR,FSKOLL,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS FROM ICC_ABAUFM"
                    + " WHERE ABAMANDANT=:ABAMANDANT AND FSKOLL=:FSKOLL  AND FSARTPRGR IN(" + FSARTPRGR + ") ) A ON"
                    + "  ABAMANDANT=EKPMANDANT AND ABAAUFKRS=EKPAUFKRS AND ABAAUFLFD=EKPAUFLFD AND ABAAUFPOS=EKPAUFPOS  "
                    + " JOIN LIEFDAT ON LSLIEFNR=EKPLIEFNR"
                    + "   WHERE EKPMANDANT=:ABAMANDANT AND EKPSA='PO' "
                    + "  GROUP BY LSLIEFNA,ABPART,FSKOLL,FSARTPRGR,EKPMEEH"
                    + " ORDER BY FSKOLL,FSARTPRGR,LSLIEFNA ";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = dwData["ABAMANDANT"].ToString();
                    or1.Parameters.Add("FSKOLL", OracleType.NVarChar).Value = dwData["FSKOLL"].ToString();
                    break;
                case 902:
                    FSARTPRGR = dwData["FSABEZ"].ToString().Trim();
                    or1.CommandText = "SELECT Z.*,NVL(LS.LSNAME1,Z.LSLIEFNR) AS LSNAME1 FROM ("
                    + "SELECT  FSSZUSCHN,FSARTPRGR,MTYPE,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,MAX(EKPME3) AS EKPME3,"
                    + " MAX(EKPNEUB) AS EKPNEUB,MAX(EKPME1) AS EKPME1,MAX(EKPWE1) AS EKPWE1,MAX(EKPBEKZ) AS EKPBEKZ,MAX(EKPBEDAT) AS EKPBEDAT,MAX(EKPKNTRNRL) AS EKPKNTRNRL,MAX(EKPVTERMIN) AS EKPVTERMIN,"
                    + "MAX(REPDAT) AS REPDAT,MAX(WAUEBM) AS WAUEBM, CASE WHEN  MAX(WAUEBM)='KG' THEN ROUND(SUM(ABARESMG*WAFGRLFD*0.001),1) ELSE SUM(ABARESMG) END AS ABARESMG,CASE WHEN  MAX(WAUEBM)='KG' THEN ROUND(SUM(ABAQTYRESERVE*WAFGRLFD*0.001),1) ELSE SUM(ABAQTYRESERVE) END AS ABAQTYRESERVE,MAX(FSABEZ) AS FSABEZ ,MAX(FSFFBEZ) AS FSFFBEZ, LSLIEFNR,MAX(EXART) AS EXART,MAX(EXCOLOR) AS EXCOLOR "
                    + " FROM (SELECT  FSSZUSCHN,FSARTPRGR,MTYPE,WAUEBM,WAFGRLFD,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,EKPME3*0.01 AS EKPME3,  EKPNEUB,EKPME1*0.01 AS EKPME1,EKPWE1*0.01 AS EKPWE1, EKPBEKZ,  EKPBEDAT,SUBSTR(EKPKNTRNRL,1,8) AS EKPKNTRNRL,  EKPVTERMIN,SUBSTR(EKPFILLER14,1,8) AS REPDAT,  ABARESMG,  ABAQTYRESERVE,FSABEZ,FSFFBEZ,NVL(EKPLIEFNR,X.LSLIEFNR) AS LSLIEFNR,EXART,EXCOLOR "
                    + " FROM ICC_ABAUFM X LEFT JOIN EKPOS ON EKPSA='PO' AND EKPAUFKRS=ABAAUFKRS AND EKPAUFLFD=ABAAUFLFD AND EKPAUFPOS=ABAAUFPOS "
                    + "  WHERE ABAMANDANT=:ABAMANDANT AND FSKOLL LIKE '%" + dwData["FSKOLL"].ToString().Trim() + "%'   AND FSARTPRGR IN(" + FSARTPRGR + ") "
                     + "  AND ABPART LIKE '" + dwData["ABPART"].ToString().Trim()
                     + "%' AND ABAART LIKE '%" + dwData["ABAART"].ToString().Trim() + "%'  ) Y "
                     + " GROUP BY  FSSZUSCHN,FSARTPRGR,MTYPE,LSLIEFNR,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS ) Z"
                     + "  LEFT JOIN LIEFDAT LS ON  LS.LSLIEFNR=Z.LSLIEFNR "
                     + " ORDER BY FSARTPRGR,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,LSNAME1";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = dwData["ABAMANDANT"].ToString();
                    //or1.Parameters.Add("FSKOLL", OracleType.NVarChar).Value = dwData["FSKOLL"].ToString();
                    break;
                case 903:
                    /*or1.CommandText = "SELECT CASE FSSZUSCHN  WHEN 'J' THEN '主面料'  WHEN ' ' THEN '里布'  WHEN 'C' THEN '衬布'   WHEN 'N' THEN '配布'  END AS  FSSZUSCHN,"
                    + "CASE MTYPE  WHEN 'T' THEN '辅料'  WHEN 'F' THEN '面料'  END AS   MTYPE "*/
                    or1.CommandText = "SELECT  ABAMANDANT,  FSSZUSCHN,'      ' AS PTYE "
                        + ",  MTYPE  ,'    ' AS PMTYP,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,SUM(EKPME1)*0.01 AS EKPME1,SUM(EKPWE1)*0.01 AS EKPWE1,MAX(EKPBEKZ) AS EKPBEKZ,MAX(EKPBEDAT) AS EKPBEDAT,SUBSTR(MAX(EKPKNTRNRL),1,8) AS EKPKNTRNRL,MAX(EKPVTERMIN) AS EKPVTERMIN,SUBSTR(MAX(EKPFILLER14),1,8) AS REPDAT,SUM(ABARESMG) AS ABARESMG,SUM(ABAQTYRESERVE) AS ABAQTYRESERVE,MAX(FSABEZ) AS FSABEZ ,MAX(FSFFBEZ) AS FSFFBEZ,LSNAME1,MAX(EXART) AS EXART,MAX(EXCOLOR) AS EXCOLOR FROM ICC_ABAUFM  LEFT JOIN EKPOS ON EKPSA='PO' AND EKPAUFKRS=ABAAUFKRS AND EKPAUFLFD=ABAAUFLFD AND EKPAUFPOS=ABAAUFPOS  LEFT JOIN LIEFDAT LS ON LS.LSLIEFNR=EKPLIEFNR"
                        + " WHERE ABAMANDANT=:ABPMANDANT AND ABAVKAUFKRS=:ABPAUFKRS AND ABAVKAUFLFD=:ABPAUFLFD AND ABPFARBE=:ABPFARBE GROUP BY ABAMANDANT,FSSZUSCHN,MTYPE, LSNAME1,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD ORDER BY ABAMANDANT,LSNAME1,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE";
                    or1.Parameters.Add("ABPMANDANT", OracleType.NVarChar).Value = dwData["ABPMANDANT"].ToString();
                    or1.Parameters.Add("ABPAUFKRS", OracleType.NVarChar).Value = dwData["ABPAUFKRS"].ToString();
                    or1.Parameters.Add("ABPAUFLFD", OracleType.NVarChar).Value = dwData["ABPAUFLFD"].ToString();
                    or1.Parameters.Add("ABPFARBE", OracleType.NVarChar).Value = dwData["ABPFARBE"].ToString();

                    break;
                case 99:
                    or1.CommandText = "SELECT DISTINCT EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,ABAVKAUFPOS,MU.ABAART,MU.ABAVAR,MU.ABAFARBE,ABAGROE,EK.EKPPRME*0.001 AS PRICE,EKPPREH AS UM,WAFGRLFD FROM EKPOS EK"
                    + " JOIN ICC_ABAUFM MU ON MU.ABAAUFKRS=EK.EKPAUFKRS AND MU.ABAAUFLFD=EK.EKPAUFLFD AND MU.ABAAUFPOS=EK.EKPAUFPOS"
                    + " WHERE EKPSA<>'AJ' AND MU.ABAVKAUFKRS=:ABAVKAUFKRS AND MU.ABAVKAUFLFD=:ABAVKAUFLFD AND "
                    + " MU.ABAART=:ABAART AND MU.ABAVAR=:ABAVAR AND MU.ABAFARBE=:ABAFARBE AND ABAGROE=:ABAGROE";
                    or1.Parameters.Add("ABAVKAUFKRS", OracleType.NVarChar).Value = dwData["ABAVKAUFKRS"].ToString();
                    or1.Parameters.Add("ABAVKAUFLFD", OracleType.NVarChar).Value = dwData["ABAVKAUFLFD"].ToString();
                    or1.Parameters.Add("ABAART", OracleType.NVarChar).Value = dwData["ABAART"].ToString();
                    or1.Parameters.Add("ABAVAR", OracleType.NVarChar).Value = dwData["ABAVAR"].ToString();
                    or1.Parameters.Add("ABAFARBE", OracleType.NVarChar).Value = dwData["ABAFARBE"].ToString();
                    or1.Parameters.Add("ABAGROE", OracleType.NVarChar).Value = dwData["ABAGROE"].ToString();
                    break;
                default:
                    break;
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "EKPOS";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
    }
}
